import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

/**
 * @ClassName Demo02_PropertiesLoad
 * @Description load 方法
 * @Author Li
 * @Date 2022/8/11 14:55
 * @ModifyDate 2022/8/11 14:55
 * @Version 1.0
 */
public class Demo02_PropertiesLoad {
    public static void main(String[] args) throws IOException {
        // 创建属性集对象
        Properties properties = new Properties();
        // 加载文本中信息到属性集
        properties.load(new FileInputStream("src/part09/ch05_Properties/info.txt"));
        Set<String> names = properties.stringPropertyNames();
        for (String name : names) {
            System.out.println(name + "=" + properties.getProperty(name));
        }
    }
}
